This repository was archived by the owner on Jul 24, 2026. It is now read-only.
feat(down): self-sever guard — refuse convoy down run from INSIDE a session it would kill - #108
Draft
myobie wants to merge 1 commit into
Draft
feat(down): self-sever guard — refuse convoy down run from INSIDE a session it would kill#108myobie wants to merge 1 commit into
convoy down run from INSIDE a session it would kill#108myobie wants to merge 1 commit into
Conversation
… session it would kill Part 4 of 4 of the decoupling-hardening task. `convoy down` typed from within a session it would kill severs the caller mid-command — an agent tearing down the network it lives in, the anti-pattern that can turn a restart into a fleet-wide outage (2026-07-22). The caller's identity is ST_AGENT (convoy bakes it into every session's env). If it names a session in the kill list, `down` now REFUSES with a clear message that names the session, unless --force (a deliberate "take me down too"). The read-only --dry-run still previews from within — only the real teardown is gated. A plain human terminal (no ST_AGENT, or an identity that is not a member) is never falsely refused. - up.ts: `selfSeverSession` (pure, injectable resolver) + the guard in `down()`, placed after the dry-run return and before the host-lock check. - Tests: pure cases for the decision + a process-level proof (real `convoy down` run as a member's identity refuses and leaves the agent alive; --force overrides; a non-member caller proceeds). Independent of parts 1-3 (touches only down() + a new test file); mergeable in any order. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014gbfntB6cu21sL4YBp21LF
myobie
marked this pull request as draft
July 22, 2026 00:36
Collaborator
Author
|
On hold per CoS: parts 3 & 4 (convoy hardening) are paused pending Nathan's morning call on swap-to-st2-and-retire-convoy vs keep-hardening. Already built + green before the hold landed; marking draft so it's not requesting review. Reopen/merge only if the decision is to keep hardening convoy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Part 4 of 4 of the decoupling-hardening task.
convoy downtyped from within a session it would kill severs the caller mid-command — an agent tearing down the network it lives in, the anti-pattern that can turn a restart into a fleet-wide outage (2026-07-22).The caller's identity is
ST_AGENT(convoy bakes it into every session's env). If it names a session in the kill list,downnow REFUSES with a message that names the session, unless--force(a deliberate "take me down too").--dry-runstill previews from within — only the real teardown is gated.ST_AGENT, or an identity that is not a member) is never falsely refused.Changes
up.ts:selfSeverSession(pure, injectable resolver) + the guard indown(), placed after the dry-run return and before the host-lock check.convoy downrun as a member's identity refuses and leaves the agent alive;--forceoverrides; a non-member caller proceeds.Full suite green.
🤖 Generated with Claude Code
https://claude.ai/code/session_014gbfntB6cu21sL4YBp21LF